A Compacting Garbage Collector for Erlang

نویسندگان

  • Kent Boortz
  • Dan Sahlin
چکیده

By utilising the fact that all data in the heap in an Erlang implementation may be arranged so that all pointers go towards earlier allocated objects, a compacting garbage collection algorithm has been designed. In contrast to a copying garbage collection algorithm, only one memory space is used. In fact, no extra memory is used at all, not even any reserved bits within the cells. The algorithm is quite easy to extend to a variant of generational garbage collection. Introduction The Erlang functional programming language [Arm96] is typically implemented using a copying garbage collection algorithm. In [Arm95] a completely new method was suggested utilising the fact that objects on the heap may be allocated so that each object only points to earlier allocated ones. In order to be able to deallocate data in the middle of the heap, without disturbing the order of objects, all objects were linked, each with a ‘history cell’ showing the time of creation. Here we propose an alternative method to utilise unidirectionality of the heap which uses a quite standard representation of the heap, not using linked lists or history cells. One main motivation to develop the algorithm was to be able to design a garbage collector for an Erlang engine that could run on systems with more limited memory resources. The algorithm presented has the following features: • It does not copy data to a new heap, thereby minimising memory fragmentation. • No extra memory is used, not even mark-bits or extra tags. • The order of the objects on the heap is preserved. • It is simple enough to make room for low level optimisations. • Execution time is linear proportional to the size of the data areas. • A version of generational garbage collection is simple to implement. • Overlapping objects are handled. The algorithm has two phases: 1. Marking, pointer updating and compaction, all combined. 2. Sliding the heap and updating external pointers. A Compacting Garbage Collector for Erlang Kent Boortz and Dan Sahlin

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Compacting Garbage Collector for Unidirectional Heaps

A unidirectional heap is a heap where all pointers go in one direction, e.g. from newer to older objects. For a strict functional language, such as Erlang, the heap may be arranged so that it is unidirectional. We here present a compacting garbage collection algorithm which utilizes the fact that a heap is unidirectional. Only one memory space is used in our algorithm. In fact, no extra memory ...

متن کامل

Garbage Collection Alternatives for Icon

Copying garbage collectors are becoming the collectors of choice for very high-level languages and for functional and object-oriented languages. Copying collectors are particularly efficient for large storage regions because their execution time is proportional only to the amount of accessible data, and they identify and compact this data in one pass. In contrast, mark-and-sweep collectors exec...

متن کامل

Combining Single-Space and Two-Space Compacting Garbage Collectors

The garbage collector presented in this paper makes use of two well known compaction garbage collection algorithms with very diierent performance characteristics: Cheney's two-space copying collector and Jon-ker's single-space sliding compaction collector. We propose a scheme which allows either collector to be used. The run-time memory requirements of the program being executed are used to det...

متن کامل

A Generational, Compacting Garbage Collector for C++

One of the most striking differences between any Lisp dialect and C++ is not the obvious syntax differences, but rather their opposing views on management of objects with indefinite extent. While Lisp systems automatically recover storage used by objects that are no longer needed by the program, C++ requires that the user explicitly delete the object in order to reclaim storage. Automatically m...

متن کامل

Stack Heap Static

A unidirectional heap is a heap where all pointers go in one direction, e.g. from newer to older objects. For a strict functional language , such as Erlang, the heap may be arranged so that it is unidirec-tional. We here present a compacting garbage collection algorithm which utilizes the fact that a heap is unidirectional. Only one memory space is used in our algorithm. In fact, no extra memor...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1997